define(
    () => {
        return (ops) => {
            class Banner {
                constructor(ops) {
                    this.url = ops.url,
                        this.ele = ops.ele,
                        this.data = ops.data,
                        this.dataList = [];
                    this.fetchData();
                }
                fetchData() {
                    $.ajax({
                        url: this.url,
                        data: this.data,
                        success: (res) => {
                            console.log("获取轮播图数据", res);
                            if (res.code === "200") {
                                this.dataList = JSON.parse(res);
                                this.renderBanner(this.ele, );
                            } else {
                                alert(JSON.parse(res.title));
                            }
                        }
                    })
                }
                renderBanner() {
                    $(this.ele).banner(this.dataList);
                }
            }
        }
    }
)